package com.leadingsoft.pwxk.converter;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;

import com.leadingsoft.common.converter.AbstractConverter;
import com.leadingsoft.pwxk.dto.OperationLogDto;
import com.leadingsoft.pwxk.enums.OperationLogType;
import com.leadingsoft.pwxk.model.OperationLog;

@Component
public class OperationLogConverter extends AbstractConverter<OperationLog, OperationLogDto> {

	@Override
	protected OperationLogDto toDtoActual(OperationLog model) {
		OperationLogDto operationLogDto = new OperationLogDto();
		BeanUtils.copyProperties(model, operationLogDto);
		operationLogDto.setType(OperationLogType.getDescByVal(model.getType()));
		return operationLogDto;
	}

	@Override
	public void copyProperties(OperationLog model, OperationLogDto dto) {
	}

}
